<!--#INCLUDE FILE="programmer.inc"-->
<!--#INCLUDE FILE="conn.asp"-->
<!-- #include file="function.asp" -->
<!-- #include file="function_charCode.asp" -->
<!-- #include file="comSub.asp" -->
<script src=inc/js1.js></script>

<%call bbsClose()%>
<!-- #include file="FriendOE.asp" -->
<%
call stylefile()
Call tslt_username_error_Exit()
%>

<html>
<head>
<%call MetaKeyw()%>
<%call MetaDesc()%>
<title>ҵղؼ</title>
<SCRIPT language="JavaScript">
            var timeout=2;
            function isReload(){
                  if(timeout!=0){
                          timeout--;
                   }else{
                          this.location.reload();
                   }
                  setTimeout("isReload()",1000)
             }
             function submitAndReload() {
                             form1.submit();
                             isReload();
             }  

             function set_onchange() {
                   if (form1.act.selectedIndex == 3)
                   {
                            Reverse();
                            var ret;
                            var ret = confirm("棡ȷťղؼС");
                            if(ret!=false)
                             {
                                    form1.button1.click();
                                    isReload();
                             }
                             else
                             {
                                    ReSet();
                                    document.form1.act.value="";
                             }
                    }
             }
             function Reverse(){
                    if(document.form1.client_Id !=null)
                    {
                           var e = document.form1.client_Id;
                          if(!e.checked)
                          {
                                 document.form1.client_Id.checked = true;
                           }
                          var idList = document.form1;
                          for(var i=0;i<idList.client_Id.length;i++)
                          {
                               var e = document.form1.client_Id[i];
                               if(!e.checked)
                               {
                                     document.form1.client_Id[i].checked = true;
                               }
                           }
                     }
             }

             function ReSet(){
                  if(document.form1.client_Id !=null)
                  {
                       var idList = document.form1;
                       document.form1.client_Id.checked = false;
                       var idList = document.form1;
                       for(var i=0;i<idList.client_Id.length;i++)
                       {
                            document.form1.client_Id[i].checked = false;
                       }
                  }
             }
</SCRIPT>
</HEAD>
<BODY topmargin=0>
<table border=0 width=100% cellspacing=0 cellpadding=1>
         <tr>
                  <td width=100 height="67" bgcolor=greenyellow>
                          <img border="0" src="images/tushan2.gif" width="100" height="65" align=middle vspace=0 hspace=0>
                  </td>
                  <td rowspan=2 bgcolor=dodgerblue>
                           <a href=advertisement/collectionAad/top.htm target="new">
                           <%
                                 set objad=server.createobject("mswc.adrotator")
                                 response.write objad.getadvertisement("advertisement/collectionAad/topadrot.txt")
                                 set objad=nothing
                            %>
                           </a>
                  </td>
         </tr>
         <tr>
                  <td height="6" bgcolor=dodgerblue>
                  </td>
         </tr>
</table>
<CENTER>
<DIV id="Cmenu1" onmouseover="showMenu(Cmenu1)" onmouseout="hideMenu(Cmenu1)" style="cursor:hand;visibility:hidden;position:absolute;left:10;top:130;">
         <%call CNavigation_BM()%>
</DIV>

<table border=0 width=970>
        <tr>
                <td align=right>
                           <span style="font-size:14"><b><%=session("tslt_username")%></b></span>
                           <span style="font-size:20">
                           <%if (session("tslt_useridentity")=1 or session("tslt_useridentity")=2) then%>
                                   <A class=a2 id="TopRight_mune1" href="admin_index/ad_index.asp"></A>
                           <%end if%>
                          <%if session("tslt_username")<>"" then%>
                                     <%if session("tslt_openFrameChat")=True then%>
                                               <A class=a2 href="javascript:parent.bottomFrame.location.href='chat/exit.asp';parent.location.href='logout.asp';"><font color=red>ע¼</font></A>
                                     <%else%>
                                               <A class=a2 href="logout.asp"><font color=red>ע¼</font></A>
                                     <%end if%>
                          <%end if%>
                          <A class=td8 id="TopRight_mune2" onmouseover="ShowDivMenu(2)">ܲ˵</A>
                          <%if session("tslt_username")<>"" then%>
                                       <A class=a2 href=sitenote.asp title="´" target="_blank"><img src="images/zndx.gif" border=0></A><A class=a2 href=sitenote.asp>վڶ</A>
                          <%end if%>
                          </span>
                            <DIV id="div_mune2" align="right" style="display:none;" onmouseover="ShowDivMenu(2)" onmouseout="HideDivMenu(2)">
                                 <table class="td8" border="0" cellspacing="0" cellpadding="0" bordercolordark='#000000' bordercolorlight='#000000'>
                                     <tr>
                                          <td class=font3>
		              <img src="images/wyl.gif" width="17" height="17" border=0><A class=a4 target="_blank" href="wyl/wy.asp">¼</A>
                                                 <%If session("tslt_openFrameChat")="" then%>
                                                               <img src="images/lts.gif" width="17" height="17" border=0><A class=a4 href="index_Frame.asp?currentPU=<%=currentPageUrl%>"></A>
                                                 <%else%>
                                                               <img src="images/lts.gif" width="17" height="17" border=0><A class=a4 href="javascript:parent.bottomFrame.location.href='chat/exit.asp';parent.location.href=self.location.href;">ر</A>
                                                  <%End if%>
                                                  &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
                                           </td>
                                     </tr>
                                 </table>
                            </DIV>
                </td>
        </tr>
        <tr>
                <td align="left" onmouseout="HideDivMenu2(2)">
                        <span style="font-size:14">
                        <img src=images/home.gif><a class=a1 onmouseover="showMenu(Cmenu1)" href=index.asp>̳ҳ</a>
                        <%if request("keyword")<>"" then%>
                                     <b></b>&nbsp;<img src="images/scj.gif" width="17" height="17" border=0><a class=a1 href=collectionA.asp>ղؼ</a>&nbsp;<b></b>&nbsp;
                        <%else%>
                                     <b></b>&nbsp;<img src="images/scj.gif" width="17" height="17" border=0>ղؼ
                        <%end if%>
                        </span>
                </td>
        </tr>
</table>
<hr width=955>

<table width=930 border="0" cellpadding="0" cellspacing="0">
          <tr>
                  <td align="left" valign="top" width=50>
                            <img src="style/<%=session("tslt_stylefolder")%>/shutiao.gif" width=50 oncontextmenu="return false">
                  </td>
                  <td valign="top" width="440">
                             <span style="position: absolute; z-index: -1"><img src="style/<%=session("tslt_stylefolder")%>/focus_j2.gif" height=30 width=440></span>
                  </td>
                   <td valign="top" width="440">
                             <span style="position: absolute; z-index: -1"><img src="style/<%=session("tslt_stylefolder")%>/focus_j2.gif" height=30 width=440></span>
                   </td>
           </tr>
</table>

<form action="11_Delreply.asp" method="post" name="form1" target="_blank">
<input type="hidden" name="isFromCollection" value="ok">
<table align="center" width="900" border="0" cellspacing="1" cellpadding="0" >
            <tr>
                    <td align="center" height="15" colspan="3"><font color="#FF0000">&nbsp;&nbsp;&nbsp; </font></td>
                    <td align="center" height="15" width="11%"><font color="#FF0000"></font></td>
                    <td align="center" height="15" width="8%"><font color="#FF0000">С</font></td>
                    <td align="center" height="15" width="11%"><font color="#FF0000"></font></td>
                    <td align="center" height="15" width="24%"><font color="#FF0000"></font></td>
                    <%if session("tslt_username")<>"" then%>
                                 <td align="center" height="15" width="5%" bordercolordark="#C0C0C0"><font color="#FF0000"></font></td>
                    <%end if%>
            </tr>
<%
            Dim Sql,Rs
            Sql="select collection From ts_userinfo where username='" & session("tslt_username") &"'"
            set Rs=conn.Execute(Sql)
                   if Rs("collection")<>"" then
                        Dim cArray
                        cArray = Split(Rs("collection"), "|")
                         dim tempCount
                         tempCount=0

                        Dim currentUBound
                         if Request("page")="" or Request("page")=1 then
                                currentUBound=collectionCount()
                         else
                               currentUBound=collectionCount()-((Request("page")-1)*showlistok())
                         end if
                         Dim i,articleId
                         For i = currentUBound To 0 step-1
                                 articleId=cArray(i)
                                 if articleId <> "" Then
                                       if CIdExist(articleId)=True then 
                                              if islockarticle(cint(articleId)) =True then 
                                                     if (session("tslt_useridentity")=1 or session("tslt_useridentity")=2 or board_BZUser(isboardid(cint(articleId)))) then
                                                           Call showArticleListField(cint(articleId))
                                                            if request("keyword")="" then
                                                                   tempCount=tempCount+1
                                                                   if tempCount=showlistok() then
                                                                           Exit For
                                                                    end if
                                                             end if
                                                      end if
                                               else
                                                      Call showArticleListField(cint(articleId))
                                                      if request("keyword")="" then
                                                             tempCount=tempCount+1
                                                             if tempCount=showlistok() then
                                                                    Exit For
                                                             end if
                                                      end if
                                               end If                                               
                                        Else 
                                            Call DelCollection(articleId) 
                                        End If 
                                 End If 
                         Next
                   else
                          Response.write "<SCRIPT language=Javascript>passwords(promptInfo_collectionA(0))</SCRIPT>"
                          Response.end
                   end if
            Rs.close
            set Rs=nothing 
%>
</table>

<%if session("tslt_username")<>"" then%>
            <div align="right">
            &nbsp;&nbsp;&nbsp;&nbsp;
            <select name=act class=input2 LANGUAGE=javascript onchange="return set_onchange();">
                         <option value="0"></option>
                         <option value="1">ᵽǰ</option>
                         <option value="2">ɾ</option>        
                         <option value="3"></option>
             </select>
             <input class="input3" type="button" name="button1" value="ȷ" LANGUAGE=javascript onclick="return submitAndReload();">&nbsp;&nbsp;&nbsp;&nbsp;
             </div>
<%end if%>

</form>

<%
if request("keyword")="" then
       Call pages()
end if
%>

<br><br>
<table border=0 cellspacing=0 cellpadding=2 align=center width=500>
           <form name=search action=collectionA.asp method=post>
           <tr bordercolor=#0099CC align=center>
                     <td bgcolor=LightBlue width=83%><font color=#000070>ؼ:</font>
                           <input type=text size=15 name=keyword maxlength=50 value=<%=request("keyword")%>>
                           <SELECT name=sel1>
		<OPTION></OPTION>
		<OPTION></OPTION>
		<OPTION></OPTION>
		<OPTION></OPTION>
                            </SELECT>
                           <input type=submit class=input3 height=18 width=39  name=b2 alt= value=>
                    </td>
                    <td>&nbsp;<a class=a1 href=javascript:history.go(-1)><b>ǰҳ</b></a></td>
           </tr>
           </form>
</table>

<%
If DemoLinkYesNo() Then 
    Call demoLink()
End If 
%>

<table align=center width="100%">
           <tr><td> 
                          <!--#INCLUDE file="bottom.asp"-->
           </td></tr>
</table>  
</BODY>
</HTML>
<%
Call conn_Nothing()

Function collectionCount()
        Dim Sql,Rs
        Sql="select collection From ts_userinfo where username='" & session("tslt_username") &"'"
        set Rs=conn.Execute(Sql)
               if Rs("collection")<>"" then
                      Dim cArray
                      cArray = Split(Rs("collection"), "|")
                      Dim p   
                      p=0     
                      Dim i
                      For i = UBound(cArray) To 0 step-1
                          articleId=cArray(i)
                           if articleId <> "" then
                                    if CIdExist(articleId)=True then 
                                                  p=p+1 
                                    end if
                            end if
                       Next
               end if
        Rs.close
        set Rs=nothing 
        collectionCount=p
End Function

Function CIdExist(strId)
                 CIdExist=False
                 dim rs
                 dim sql
                 sql="select id from article" 
                 set rs=conn.execute(sql)
                      do while not rs.eof
                           If rs("id")=cint(strId) Then
                                  CIdExist=True
                                  Exit Function
                           Else
	                   CIdExist=False
                           End If 
                           rs.movenext
                      loop
                rs.close
                set rs=nothing 
End Function

Sub showArticleListField(articleId)
       dim objRS
       dim objSQL
        if request("keyword")<>"" then
               dim keyword2
               keyword2=trim(request("keyword"))
               sel1=trim(request("sel1"))
               if sel1<>"" then
                      if sel1="" then
                             objSQL = "SELECT * FROM article where id="&articleId&" and (user like '%"& keyword2 &"%')"
                      elseif sel1="" then
                             objSQL = "SELECT * FROM article where id="&articleId&" and (subject like '%"& keyword2 &"%')"
                      elseif sel1="" then
                             objSQL = "SELECT * FROM article where id="&articleId&" and (Content like '%"& keyword2 &"%')"
                      else
                             objSQL = "SELECT * FROM article where id="&articleId
                      end if
               end if
        else
               objSQL="SELECT * FROM article where id="&articleId
        end if
        set objRS=conn.execute(objSQL)
                If objRS.Eof And objRS.Bof Then
                              Exit Sub
               end if
               Response.Write "<TR height='20' class=td1 onmouseover=sbar(this) onmouseout=cbar(this)>"
               Response.Write "<td class='titleBottomBorder' width='3%' align='left' valign='baseline'>"
               if request("page")<>"" then
                      Response.Write "<a class=a2 href=11.asp?id=" & objRS("id") & "&page=" &request("page")& "&keyword=" &request("keyword")&"&sel1="&request("sel1")&"&collectionApage=yes target='_blank'>" 
               else
                      Response.Write "<a class=a2 href=11.asp?id=" & objRS("id") & "&keyword=" &request("keyword")&"&sel1="&request("sel1")&"&collectionApage=yes target='_blank'>" 
               end If
               if objRS("adminindex")=true then 
                     Response.Write"<img src='images/top1.gif' alt='̶ܹ"
               elseif objRS("topfirst")=true then 
                     Response.Write"<img src='images/top2.gif' alt='̶"
               elseif objRS("top1")=true then 
                     Response.Write"<img src='images/top3.gif' alt='̶"
               elseif objRS("jinghua") then 
                     Response.Write"<img src='images/jh.gif' alt='"
               elseif objRS("board_bulletin") then 
                     Response.Write"<img src='images/star.GIF' alt='"
                elseif objRS("lockarticle") Then
                     if (session("tslt_useridentity")=1 or session("tslt_useridentity")=2 or board_BZUser(objRS("boardid"))) then
                          Response.Write"<img src='images/lock.gif' alt='"
		             End If 
               elseif objRS("transmit") then
                     If (session("tslt_useridentity")=1 Or session("tslt_useridentity")=2 Or board_BZUser(objRS("boardid"))) Then
                         Response.Write"<img src='images/transmit.gif' alt='ת"					 
		             Else
                         Response.Write"<img src='images/tiezi.gif' alt='´"
		             End If 
               elseif objRS("dustbin") then
                     If (session("tslt_useridentity")=1 Or session("tslt_useridentity")=2) Then
                         Response.Write"<img src='images/dustbin.gif' alt='"					 
		             Else
                         Response.Write"<img src='images/tiezi.gif' alt='´"
		             End If 
               else
                      Response.Write"<img src='images/tiezi.gif' alt='´"
               end If
               Response.Write"԰顼 "&boardname(objRS("boardid"))&" ' border=0>&nbsp;"
               Response.Write"</a>"
               Response.Write "</td>"
               Response.Write "<td class='titleBottomBorder' width='1%' align='left' valign='baseline'>"
                     if replyList2(objRS("id")) Then
                             Response.Write "<img src='images/plus.gif' alt='ظ' id='Tag"& objRS("id") &"' style='cursor:hand;' onclick='turnit(Reply"& objRS("id") &" ,Tag"& objRS("id") &");showReplyPage("&objRS("id")&","&objRS("AllReplySize")&","&objRS("id")&");'>"
                     else
                              Response.Write "<img src='images/minus.gif' alt='޻ظ' id='Tag"& objRS("id") &"' style='cursor:hand;' onclick='turnit(Reply"& objRS("id") &" ,Tag"& objRS("id") &");showReplyPage("&objRS("id")&","&objRS("AllReplySize")&","&objRS("id")&");'>"
                     end if
               Response.Write "</td>"
               Response.Write "<td class='titleBottomBorder' align='left'>"
               if request("page")<>"" then
					  Response.Write "&nbsp;<a class=a2 href=11.asp?id=" & objRS("id") & "&page=" &request("page")& "&keyword=" &request("keyword")&"&sel1="&request("sel1")&"&collectionApage=yes title='"& objRS("subject") &"&#13;&#10;"&objRS("firstAddTime")&"'><font size=4><b>" 
               else
                      Response.Write "&nbsp;<a class=a2 href=11.asp?id=" & objRS("id") & "&keyword=" &request("keyword")&"&sel1="&request("sel1")&"&collectionApage=yes title='"& objRS("subject") &"&#13;&#10;"&objRS("firstAddTime")&"'><font size=4><b>" 
               end if
               if objRS("secret") then response.write"<font color='#bbbbbb'>" 
               if len(objRS("subject"))>17 then
                      Response.write (left(objRS("subject"),17))&"..." 
               else 
                      Response.write objRS("subject")&""
               end if 
               Response.Write"</b></font></a>"
               Response.Write "</td>"
               Response.Write "<td class='titleBottomBorder' align='right'><span class=fontsize>"
               if objRS("user")<>"" then
                      call UserInfoLink(objRS("user"))
               else
                      Response.Write "(ο)"
               end if
               Response.Write "</span>"
               Response.Write "</td>"
               Response.Write "<td class='titleBottomBorder' align='right'><span class=fontsize>" &objRS("contentsize2")& "/" &FileContentSize2(objRS("AllReplySize"))& "</span></td>"
               Response.Write "<td class='titleBottomBorder' align='center'><span class=fontsize>"&objRS("AllReplyCount")& "/" &objRS("ReadCount")&"</span></td>"
               if NewRH(objRS("ID"))<>"" then      
                      Response.Write "<td class='titleBottomBorder' align='left'><span class=fontsize>" &objRS("lastReplyTime")&"<a title=' "&NewRH(objRS("ID"))&" '>" &(left(NewRH(objRS("ID")),6))&"</a></span></td>"
               else
                      Response.Write "<td class='titleBottomBorder' align='left'><span class=fontsize>" &objRS("lastReplyTime")   
                      if replyList2(objRS("id"))=true then    
                           Response.Write "(ο)"
                      end if
                      Response.Write "</span></td>"
               end if
               if session("tslt_username")<>"" then
                    Response.Write "<td class='titleBottomBorder' align='center'><input type='checkbox' value='on' name="&objRS("id")&" id='client_Id'></td>"
               end if
               Response.Write "</TR>"
               Response.Write "<TR>"
               Response.Write "<td colspan=8 id='Reply"& objRS("id") &"' style='DISPLAY: none'>"
               Response.Write "<b>ȡС</b>"
               Response.Write "</td>"
               Response.Write "</TR>"
        objRS.close
        set objRS=nothing 
End Sub

Sub DelCollection(articleId)
       Dim Sql,Rs
       Sql="select collection From ts_userinfo where username='" & session("tslt_username") & "'"
       set Rs=conn.Execute(sql)
                  Dim collection2
                  collection2 = Rs("collection")
                   if collection2<>"" then
                          if instr(collection2,articleId)<>false Then
                                 collection2=replace(collection2,"|"&articleId&"|","|")
                                 conn.Execute("update ts_userinfo set collection='"&collection2&"' where username='"&session("tslt_username")&"'")
                          end if
                    end if
        RS.close              
        Set RS = Nothing
End Sub

sub pages()
        Dim Page      
        Page = Request("Page")
        if request("page")="" then
            page=1
        else
            page=cint(request("page"))
        end if
        Dim totalPage
        if (collectionCount() mod showlistok())=0 then
               totalPage=(collectionCount()/showlistok())
        else
               totalPage=(collectionCount()\showlistok())+1
        end if
        if collectionCount()<>0 then
             Dim currid1,currid2
             if totalPage>10 then 
                   if Page mod 10=0 then
                          currid1=Page
                          currid2=Page-9
                   else
                          if totalPage mod 10=0 then 
                                 currid1=int(Page/10)*10+10
                          else 
                                  if int(Page/10)=int(totalPage/10) then currid1=(totalPage/10)*10 else currid1=int(Page/10)*10+10
                           end if
                           currid2=int(Page/10)*10+1
                    end if
             else 
                    currid1=totalPage mod 10
                    currid2=int(totalPage/10)*10+1
             end if
%>
             <table align=left>
                   <tr><td>
<%
                            if totalPage>1 Then
                                   If Page=totalPage or Page<>1 Then 
                                           Dim PrwePage
                                           PrwePage=Page-1
                                           Response.Write "<A class=a1 HREF=collectionA.asp?Page="&PrwePage&"&keyword="&keyword2&"&sel1="&request("sel1")
                                           Response.Write "><font size=4>һҳ</font></A>  "              
                                    End If  
                             End If          
%>
                    </td></tr>
             </table>
             <table border="0"  align="left">
                    <tr><td>
                          <FONT face=webdings size=2>
                          <%if Page=1 then%>
                                     <span style="color: #FF0000">9</span>
                          <%else%>
                                     <a class=a2 href="collectionA.asp?Page=1<%="&keyword="&keyword2&"&sel1="&request("sel1")%>">9</a>
                          <%end if%>
                          <%if Page>10 then%>
                                      <a class=a2 href="collectionA.asp?Page=<%=currid2-1&"&keyword="&keyword2&"&sel1="&request("sel1")%>">7</a>
                          <%end if%>
                          </FONT>
                          <strong>
<%
                          Dim i
                          for i=currid2 to currid1
                                 if Page=i then 
	                       Response.Write("<font color=red size=4>"&i&"</font>  ")
                                 else
%>
                                         <FONT size=2>
                                         <a class=a2 href="collectionA.asp?Page=<%=i&"&keyword="&keyword2&"&sel1="&request("sel1")%>">
                                                <%Response.Write i%>
                                         </a>
                                         </FONT>
<%
                                  end if
                                  Response.Write " "
                          next
%>
                          </strong>
                          <FONT face=webdings size=2>
                          <%if currid1<totalPage then%>
                                       <a class=a2 href="collectionA.asp?Page=<%=currid1+1&"&keyword="&keyword2&"&sel1="&request("sel1")%>">8</a>
                          <%end if%>
                          </FONT> 
                          <FONT face=webdings size=2>
                          <%if Page=totalPage then%>
                                       <span style="color: #FF0000">:</span>
                           <%else%>
                                        <a class=a2 href="collectionA.asp?Page=<%=totalPage&"&keyword="&keyword2&"&sel1="&request("sel1")%>">:</a>
                            <%end if%>
                            </FONT>
                    </td></tr>
             </table>
             <table align=left>
                    <tr><td>
<% 
                            if totalPage>1 Then
                                    If page=1 or totalPage>Page Then
                                            NextPage=Page+1
                                             Response.Write "<A  class=a1 HREF=collectionA.asp?Page="&NextPage&"&keyword="&keyword2&"&sel1="&request("sel1")
                                             Response.Write "><font size=4>һҳ</font></A>"
                                     End If
                              End If
%>
                     </td></tr>
             </table>
             <table align=right>
                     <tr><td>
<%
                              if Page>totalPage then
                                     PageNo=totalPage
                              end if
                              Response.Write "<font size=2>ҳΣ<font color=red><b>"& Page &"</b></font>/<b>"& totalPage &"</b>ҳ ,<b>"& collectionCount() &"</b></font>"
                              Response.Write "&nbsp;&nbsp;&nbsp;&nbsp;"
%>
                     </td></tr>
              </table>
<% 
       end if
end sub


%>


